#include <iostream>
#include <cstdio>
using namespace std;
string zipstr(string str)
{
	string zip;
	int  n = 1;
	for(int i=0;i<str.length();i++)
	{
		if(str[i]==str[i+1])
		{
			n++;
		}
		else
		{
			char tmp[5] ;
			sprintf(tmp,"%d",n);
			string str_n = tmp;
			zip += str[i];
			if(n!=1)
				zip += str_n;
			n = 1;
		}
		
	}
	return zip;
}
int main()
{
	string str;
	cin>>str;
	cout<<zipstr(str)<<endl;
	return 0;
}
